/*
 * Copyright 2023 LINE Corporation
 *
 * LINE Corporation licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech Do not edit the class manually.
 */
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Request object for creating a coupon. Contains all configurable coupon properties. */
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record CouponCreateRequest(
    /** Get acquisitionCondition */
    @JsonProperty("acquisitionCondition") AcquisitionConditionRequest acquisitionCondition,
    /** URL of the barcode image associated with the coupon. Used for in-store redemption. */
    @JsonProperty("barcodeImageUrl") String barcodeImageUrl,
    /** Unique code to be presented by the user to redeem the coupon. Optional. */
    @JsonProperty("couponCode") String couponCode,
    /** Detailed description of the coupon. Displayed to users. */
    @JsonProperty("description") String description,
    /** Coupon expiration time (epoch seconds). Coupon cannot be used after this time. */
    @JsonProperty("endTimestamp") Long endTimestamp,
    /** URL of the main image representing the coupon. Displayed in the coupon list. */
    @JsonProperty("imageUrl") String imageUrl,
    /**
     * Maximum number of times a single coupon ticket can be used. Use -1 to indicate no limit.
     * maximum: 1
     */
    @JsonProperty("maxUseCountPerTicket") Integer maxUseCountPerTicket,
    /** Coupon start time (epoch seconds). Coupon can be used from this time. */
    @JsonProperty("startTimestamp") Long startTimestamp,
    /** Title of the coupon. Displayed in the coupon list. */
    @JsonProperty("title") String title,
    /** Conditions for using the coupon. Shown to users. */
    @JsonProperty("usageCondition") String usageCondition,
    /** Get reward */
    @JsonProperty("reward") CouponRewardRequest reward,
    /** Visibility of the coupon. Determines who can see or acquire the coupon. */
    @JsonProperty("visibility") Visibility visibility,
    /** Timezone for interpreting start and end timestamps. */
    @JsonProperty("timezone") Timezone timezone) {

  /** Visibility of the coupon. Determines who can see or acquire the coupon. */
  public enum Visibility {
    @JsonProperty("UNLISTED")
    UNLISTED,
    @JsonProperty("PUBLIC")
    PUBLIC,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  /** Timezone for interpreting start and end timestamps. */
  public enum Timezone {
    @JsonProperty("ETC_GMT_MINUS_12")
    ETC_GMT_MINUS_12,
    @JsonProperty("ETC_GMT_MINUS_11")
    ETC_GMT_MINUS_11,
    @JsonProperty("PACIFIC_HONOLULU")
    PACIFIC_HONOLULU,
    @JsonProperty("AMERICA_ANCHORAGE")
    AMERICA_ANCHORAGE,
    @JsonProperty("AMERICA_LOS_ANGELES")
    AMERICA_LOS_ANGELES,
    @JsonProperty("AMERICA_PHOENIX")
    AMERICA_PHOENIX,
    @JsonProperty("AMERICA_CHICAGO")
    AMERICA_CHICAGO,
    @JsonProperty("AMERICA_NEW_YORK")
    AMERICA_NEW_YORK,
    @JsonProperty("AMERICA_CARACAS")
    AMERICA_CARACAS,
    @JsonProperty("AMERICA_SANTIAGO")
    AMERICA_SANTIAGO,
    @JsonProperty("AMERICA_ST_JOHNS")
    AMERICA_ST_JOHNS,
    @JsonProperty("AMERICA_SAO_PAULO")
    AMERICA_SAO_PAULO,
    @JsonProperty("ETC_GMT_MINUS_2")
    ETC_GMT_MINUS_2,
    @JsonProperty("ATLANTIC_CAPE_VERDE")
    ATLANTIC_CAPE_VERDE,
    @JsonProperty("EUROPE_LONDON")
    EUROPE_LONDON,
    @JsonProperty("EUROPE_PARIS")
    EUROPE_PARIS,
    @JsonProperty("EUROPE_ISTANBUL")
    EUROPE_ISTANBUL,
    @JsonProperty("EUROPE_MOSCOW")
    EUROPE_MOSCOW,
    @JsonProperty("ASIA_TEHRAN")
    ASIA_TEHRAN,
    @JsonProperty("ASIA_TBILISI")
    ASIA_TBILISI,
    @JsonProperty("ASIA_KABUL")
    ASIA_KABUL,
    @JsonProperty("ASIA_TASHKENT")
    ASIA_TASHKENT,
    @JsonProperty("ASIA_COLOMBO")
    ASIA_COLOMBO,
    @JsonProperty("ASIA_KATHMANDU")
    ASIA_KATHMANDU,
    @JsonProperty("ASIA_ALMATY")
    ASIA_ALMATY,
    @JsonProperty("ASIA_RANGOON")
    ASIA_RANGOON,
    @JsonProperty("ASIA_BANGKOK")
    ASIA_BANGKOK,
    @JsonProperty("ASIA_TAIPEI")
    ASIA_TAIPEI,
    @JsonProperty("ASIA_TOKYO")
    ASIA_TOKYO,
    @JsonProperty("AUSTRALIA_DARWIN")
    AUSTRALIA_DARWIN,
    @JsonProperty("AUSTRALIA_SYDNEY")
    AUSTRALIA_SYDNEY,
    @JsonProperty("ASIA_VLADIVOSTOK")
    ASIA_VLADIVOSTOK,
    @JsonProperty("ETC_GMT_PLUS_12")
    ETC_GMT_PLUS_12,
    @JsonProperty("PACIFIC_TONGATAPU")
    PACIFIC_TONGATAPU,

    @JsonEnumDefaultValue
    UNDEFINED;
  }

  public static class Builder {
    private AcquisitionConditionRequest acquisitionCondition;
    private String barcodeImageUrl;
    private String couponCode;
    private String description;
    private Long endTimestamp;
    private String imageUrl;
    private Integer maxUseCountPerTicket;
    private Long startTimestamp;
    private String title;
    private String usageCondition;
    private CouponRewardRequest reward;
    private Visibility visibility;
    private Timezone timezone;

    public Builder(
        AcquisitionConditionRequest acquisitionCondition,
        Long endTimestamp,
        Integer maxUseCountPerTicket,
        Long startTimestamp,
        String title,
        Visibility visibility,
        Timezone timezone) {

      this.acquisitionCondition = acquisitionCondition;

      this.endTimestamp = endTimestamp;

      this.maxUseCountPerTicket = maxUseCountPerTicket;

      this.startTimestamp = startTimestamp;

      this.title = title;

      this.visibility = visibility;

      this.timezone = timezone;
    }

    public Builder barcodeImageUrl(String barcodeImageUrl) {
      this.barcodeImageUrl = barcodeImageUrl;
      return this;
    }

    public Builder couponCode(String couponCode) {
      this.couponCode = couponCode;
      return this;
    }

    public Builder description(String description) {
      this.description = description;
      return this;
    }

    public Builder imageUrl(String imageUrl) {
      this.imageUrl = imageUrl;
      return this;
    }

    public Builder usageCondition(String usageCondition) {
      this.usageCondition = usageCondition;
      return this;
    }

    public Builder reward(CouponRewardRequest reward) {
      this.reward = reward;
      return this;
    }

    public CouponCreateRequest build() {
      return new CouponCreateRequest(
          acquisitionCondition,
          barcodeImageUrl,
          couponCode,
          description,
          endTimestamp,
          imageUrl,
          maxUseCountPerTicket,
          startTimestamp,
          title,
          usageCondition,
          reward,
          visibility,
          timezone);
    }
  }
}
